From: Chong Yidong Date: Mon, 14 May 2007 14:53:15 +0000 (+0000) Subject: (pbm_load): Check image size for monochrome pbm. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~18878 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=78bee9a8044257d304e05aac48fe72dc3cf7dc33;p=emacs.git (pbm_load): Check image size for monochrome pbm. --- diff --git a/src/image.c b/src/image.c index eacea4a1d97..12b27fe359f 100644 --- a/src/image.c +++ b/src/image.c @@ -5730,7 +5730,17 @@ pbm_load (f, img) if (raw_p) { if ((x & 7) == 0) - c = *p++; + { + if (p >= end) + { + x_destroy_x_image (ximg); + x_clear_image (f, img); + image_error ("Invalid image size in image `%s'", + img->spec, Qnil); + goto error; + } + c = *p++; + } g = c & 0x80; c <<= 1; }